﻿package mortal.game.view.palyer.view
{
    import Message.DB.Tables.*;
    import Message.Game.*;
    import Message.Public.*;
    import com.greensock.*;
    import com.greensock.easing.*;
    import com.mui.manager.*;
    import com.mui.utils.*;
    import extend.language.*;
    import fl.data.*;
    import flash.events.*;
    import flash.utils.*;
    import frEngine.pools.*;
    import mortal.component.gconst.*;
    import mortal.component.window.*;
    import mortal.game.cache.*;
    import mortal.game.cache.packCache.*;
    import mortal.game.events.*;
    import mortal.game.manager.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.resource.tableConfig.*;
    import mortal.game.scene3D.map3D.util.*;
    import mortal.game.scene3D.player.entity.*;
    import mortal.game.utils.*;
    import mortal.game.view.common.*;
    import mortal.game.view.common.item.*;
    import mortal.game.view.common.util.*;
    import mortal.game.view.mount.panel.*;
    import mortal.game.view.palyer.data.*;
    import mortal.game.view.palyer.util.*;
    import mortal.game.view.wizard.panel.*;
    import mortal.mvc.core.*;

    public class WingPanel extends FashionPanelBase
    {
        private var _tween1:TweenMax;
        private var _tween2:TweenMax;
        private var _modelX:Number;
        private var _isActiveVip:Boolean;

        public function WingPanel(param1:Window)
        {
            _fashionType = EAdvanceComponentType._EAdvanceComponentTypeWing;
            super(param1);
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            return;
        }// end function

        override protected function createChildren() : void
        {
            super.createChildren();
            _currCombatTxt.imgUrl = ImagesConst.FashionCombat_Wing;
            _currAttrTxt.imgUrl = ImagesConst.FashionAttr_Wing;
            _advanceTitle.imgUrl = ImagesConst.Fashion_AdvanceWing;
            _skillLabel.imgUrl = ImagesConst.Fashion_WingSkillText;
            _hideBox = UIFactory.checkBox(Language.getString(41304), 12 + 399, 385 - 28 + 107, 82, 20, _window.contentTopOf3DSprite);
            _hideBox.configEventListener(MouseEvent.CLICK, this.onHideWingHandler);
            _vipSpr = UICompomentPool.getUICompoment(ToolTipSprite);
            _vipSpr.x = 35;
            _vipSpr.y = 80;
            _vipSpr.toolTipData = this.getVipToolTip;
            _window.contentTopOf3DSprite.addChild(_vipSpr);
            _vipIcon = UIFactory.gImageBitmap("", 0, 0, _vipSpr);
            _fashionSharpEquip = UICompomentPool.getUICompoment(OtherEquipItem);
            _fashionSharpEquip.isSHowQuality = false;
            _fashionSharpEquip.isShowColorBg = false;
            _fashionSharpEquip.doubleClickEnabled = true;
            _fashionSharpEquip.setItemStyle(ItemStyleConst.Small, ImagesConst.PrescriptionEquipBg, 10, 13);
            _fashionSharpEquip.x = 13 + 20;
            _fashionSharpEquip.y = 112;
            _fashionSharpEquip.pos = 4;
            _fashionSharpEquip.configEventListener(MouseEvent.CLICK, this.openWardrobeHandler);
            _equipSpr.addChild(_fashionSharpEquip);
            _wardrobeEnterBtn = UIFactory.gLoadingButton(ResFileConst.WardrobeEnterBtn, 33 + 9, 112 + 58, 46, 23, _equipSpr);
            _wardrobeEnterBtn.configEventListener(MouseEvent.CLICK, this.openWardrobeHandler);
            this.initHideState();
            this.updateVipIcon();
            this.updateShapEquip();
            _rotate3d.addListeners();
            return;
        }// end function

        override protected function initHideState() : void
        {
            var _loc_1:* = Cache.instance.fashion.getFashionHideState(_fashionType);
            _hideBox.selected = _loc_1 == EFashionStatus._EFashionStatusHide ? (true) : (false);
            return;
        }// end function

        override protected function initRoleModel() : void
        {
            var _loc_1:int = 0;
            var _loc_2:int = 0;
            var _loc_3:int = 0;
            var _loc_4:int = 0;
            var _loc_5:int = 0;
            var _loc_6:int = 0;
            var _loc_7:int = 0;
            if (_rect3d)
            {
                _roleModelPlayer = FrObjectPool.getObject(UserModelPlayer, this);
                _loc_1 = Cache.instance.role.entityInfo.career;
                _loc_2 = Cache.instance.role.entityInfo.sex;
                _loc_3 = Cache.instance.role.roleEntityInfo.clothes;
                if (GameMapUtil.curMapState.isSunbathMap)
                {
                    _loc_3 = 0;
                }
                _loc_4 = Cache.instance.role.roleEntityInfo.weapon;
                _loc_5 = Cache.instance.role.roleEntityInfo.hair;
                _loc_6 = Cache.instance.role.roleEntityInfo.wing;
                _loc_7 = Cache.instance.role.roleEntityInfo.entityInfo.VIP;
                _roleModelPlayer.updateInfo(_loc_1, _loc_2, _loc_3, 0, 0, _loc_6, _loc_7);
                _roleModelPlayer.scaleAll = 2.3;
                _roleModelPlayer.useLight();
                _roleModelPlayer.rotationX = 0;
                _roleModelPlayer.rotationY = 0;
                _rect3d.addObject3d(_roleModelPlayer, 73 + 72 + 94, 133 + 223 + 20 + 20);
                _rotate3d.model = _roleModelPlayer;
                this._modelX = _roleModelPlayer.x;
                this.updateRoleModel();
            }
            return;
        }// end function

        private function initNextModel() : void
        {
            var _loc_1:int = 0;
            var _loc_2:int = 0;
            var _loc_3:int = 0;
            var _loc_4:int = 0;
            var _loc_5:int = 0;
            var _loc_6:int = 0;
            var _loc_7:int = 0;
            var _loc_8:int = 0;
            var _loc_9:TMountConfig = null;
            if (_rect3d)
            {
                _nextModelPlayer = FrObjectPool.getObject(UserModelPlayer, this);
                _loc_1 = Cache.instance.role.entityInfo.career;
                _loc_2 = Cache.instance.role.entityInfo.sex;
                _loc_3 = Cache.instance.role.roleEntityInfo.clothes;
                if (GameMapUtil.curMapState.isSunbathMap)
                {
                    _loc_3 = 0;
                }
                _loc_4 = Cache.instance.role.roleEntityInfo.weapon;
                _loc_5 = Cache.instance.role.roleEntityInfo.hair;
                _loc_6 = Cache.instance.role.roleEntityInfo.wing;
                _loc_7 = Cache.instance.role.roleEntityInfo.entityInfo.VIP;
                _nextModelPlayer.updateInfo(_loc_1, _loc_2, _loc_3, 0, 0, _loc_6, _loc_7);
                _nextModelPlayer.scaleAll = 2.3;
                _nextModelPlayer.useLight();
                _nextModelPlayer.rotationY = 50;
                _rect3d.addObject3d(_nextModelPlayer, 73 + 72 + 94, 133 + 223 + 20 + 20);
                _loc_8 = _data.advanceInfo.code + 1;
                if (_loc_8 <= FashionConst.FashionAdvanceMaxLevel)
                {
                    _loc_9 = MountConfig.instance.getFashionInfoByCode(_fashionType, _loc_8);
                    if (_loc_9 && _roleModelPlayer)
                    {
                        _nextModelPlayer.wing = _loc_9.modelId;
                        _nextModelPlayer.loadWing();
                    }
                }
            }
            return;
        }// end function

        override protected function updateAll() : void
        {
            _data = Cache.instance.fashion.getFashionInfo(_fashionType);
            if (_data && _data.advanceInfo)
            {
                this.updateEquip();
                this.updateShapEquip();
                updateSkill();
                updateLevelName();
                this.updateAttr();
                this.updateCombat();
                this.updatePropItem();
                updateCurrShap();
                updateFashionName();
                clearBtnState();
                updateSwitchBtnState();
                updateChangeBtnState();
                updateAdvanceInfo();
                updateProgressInfo();
                updateConsumeInfo();
                updateCd();
            }
            return;
        }// end function

        override protected function updateRoleModel(param1:int = 0) : void
        {
            var _loc_2:int = 0;
            if (_data == null)
            {
                return;
            }
            if (param1 != 0)
            {
                _loc_2 = param1;
            }
            else
            {
                _loc_2 = _data.advanceInfo.shapeCode;
            }
            var _loc_3:* = MountConfig.instance.getFashionInfoByCode(_fashionType, _currSelCode);
            if (_loc_3 && _roleModelPlayer)
            {
                _roleModelPlayer.wing = _loc_3.modelId;
                _roleModelPlayer.loadWing();
            }
            return;
        }// end function

        private function updateNextModel() : void
        {
            if (_roleModelPlayer == null)
            {
                return;
            }
            if (_nextModelPlayer == null)
            {
                this.initNextModel();
            }
            _roleModelPlayer.rotationY = 50;
            _roleModelPlayer.rotationY = _roleModelPlayer.rotationY % 360;
            this._tween1 = TweenMax.to(_roleModelPlayer, 1, {x:this._modelX - 105, rotationY:-50, ease:Quint.easeOut});
            this._tween2 = TweenMax.to(_nextModelPlayer, 1, {x:this._modelX + 105, alpha:0.6, ease:Quint.easeOut});
            return;
        }// end function

        override protected function updateEquip() : void
        {
            var _loc_4:ItemEquipInfo = null;
            var _loc_6:Object = null;
            var _loc_1:* = Cache.instance.pack.getFashionPackCacheByCode(EAdvanceComponentType._EAdvanceComponentTypeWing).getAllEquip();
            var _loc_2:* = new Array(4);
            var _loc_3:int = 0;
            while (_loc_3 < _loc_1.length)
            {
                
                if (_loc_1[_loc_3])
                {
                    if (_loc_1[_loc_3].itemInfo.type < 4)
                    {
                        _loc_2[_loc_1[_loc_3].itemInfo.type] = _loc_1[_loc_3];
                    }
                    else
                    {
                        _loc_1.splice(_loc_3, 1);
                        _loc_3 = _loc_3 - 1;
                    }
                }
                _loc_3++;
            }
            if (_loc_1 && _loc_1.length < 4)
            {
                _loc_3 = 0;
                while (_loc_3 < _loc_2.length)
                {
                    
                    if (!_loc_2[_loc_3])
                    {
                        _loc_4 = ItemConfig.instance.getFashionEquipByLevel(EProp._EPropFashionWingEquip, _loc_3, 3, 3);
                        if (_loc_4)
                        {
                            _loc_2[_loc_3] = new ItemData(_loc_4.code);
                            _loc_6 = {};
                            _loc_6.isDefault = true;
                            _loc_2[_loc_3].extData = _loc_6;
                        }
                    }
                    _loc_3++;
                }
            }
            var _loc_5:* = new DataProvider();
            _loc_5.addItems(_loc_2);
            _equipList.dataProvider = _loc_5;
            _equipList.drawNow();
            return;
        }// end function

        protected function updateShapEquip() : void
        {
            var _loc_1:Array = null;
            var _loc_2:ItemData = null;
            var _loc_3:ItemData = null;
            if (_wardrobeEnterBtn)
            {
                _loc_1 = Cache.instance.pack.getFashionPackCacheByCode(_fashionType).getAllEquip();
                for each (_loc_3 in _loc_1)
                {
                    
                    if (_loc_3.itemInfo.type == 4)
                    {
                        _loc_2 = _loc_3;
                    }
                }
                _fashionSharpEquip.itemData = _loc_2;
                if (_loc_2 == null)
                {
                    _fashionSharpEquip.midLabel = Language.getString(41271);
                    this.removeHideFasionBtn();
                }
                else
                {
                    _fashionSharpEquip.midLabel = "";
                    this.addHideFasionBtn();
                }
            }
            return;
        }// end function

        override protected function updateCombat() : void
        {
            var _loc_2:AdvanceAttrData = null;
            var _loc_3:int = 0;
            var _loc_4:Number = NaN;
            var _loc_1:Number = 0;
            for each (_loc_2 in _currAdvanceAttrData)
            {
                
                _loc_1 = _loc_1 + CombatUtil.getCombatValueByName(_loc_2.attrName, _loc_2.totalValue);
            }
            _loc_3 = FashionUtil.getSkillCombat(_fashionType);
            _combat.text = int(_loc_1 + _loc_3) + "";
            _loc_4 = 0;
            for each (_loc_2 in _currAdvanceAttrData)
            {
                
                _loc_4 = _loc_4 + CombatUtil.getCombatValueByName(_loc_2.attrName, _loc_2.attrUpValue);
            }
            _upCombat.text = int(_loc_4) + "";
            return;
        }// end function

        override protected function updateAttr() : void
        {
            var _loc_1:TMountConfig = null;
            var _loc_2:TMountConfig = null;
            var _loc_3:Array = null;
            var _loc_4:Array = null;
            var _loc_5:String = null;
            var _loc_6:DataProvider = null;
            var _loc_7:AdvanceAttrData = null;
            var _loc_8:AdvanceAttrData = null;
            if (_data.advanceInfo)
            {
                _loc_1 = MountConfig.instance.getFashionInfoByCode(_fashionType, _data.advanceInfo.code);
                _loc_2 = MountConfig.instance.getFashionInfoByCode(_fashionType, (_data.advanceInfo.code + 1));
                if (_loc_1)
                {
                    _loc_3 = [];
                    _loc_4 = FashionUtil.attrs;
                    for each (_loc_5 in _loc_4)
                    {
                        
                        _loc_7 = this.getAdvanceAttrData(_loc_5, _loc_1);
                        if (_loc_2)
                        {
                            _loc_8 = this.getAdvanceAttrData(_loc_5, _loc_2);
                            _loc_7.attrUpValue = _loc_8.totalValue - _loc_7.totalValue;
                        }
                        _loc_3.push(_loc_7);
                    }
                    _currAdvanceAttrData = _loc_3;
                    _loc_6 = new DataProvider();
                    _loc_6.addItems(_loc_3);
                    _attrList.dataProvider = _loc_6;
                    _attrList.drawNow();
                }
            }
            return;
        }// end function

        private function getAdvanceAttrData(param1:String, param2:TMountConfig) : AdvanceAttrData
        {
            var _loc_10:Boolean = false;
            var _loc_11:int = 0;
            var _loc_3:* = new AdvanceAttrData();
            _loc_3.attrName = param1;
            _loc_3.baseAttrValue = int(param2[param1]);
            var _loc_4:* = new ItemData(FashionConst.PropCode_Wing_Growth);
            _loc_3.growthAttrValue = FashionUtil.getGrowthGainAttr(_loc_4, param1, _data.advanceInfo.totalGrowthNum);
            var _loc_5:* = new ItemData(FashionConst.PropCode_Wing_Talent);
            var _loc_6:* = _loc_5.itemInfo.effectEx * 0.01;
            _loc_3.talentAttrValue = _loc_3.baseAttrValue * _loc_6 * _data.advanceInfo.totalTalentNum;
            var _loc_7:* = this.getEquipGainAttr();
            _loc_3.equipAttrValue = _loc_7[param1] as int;
            var _loc_8:* = Cache.instance.vip.level;
            var _loc_9:* = VipConfig.instance.getVipConfigByType(EVipRecordType._EVipRecordTypeWingEffect);
            if (_loc_8 > 0 && _loc_9 != null)
            {
                _loc_10 = int(_loc_9["vip" + _loc_8]) == 0 ? (false) : (true);
                if (_loc_10)
                {
                    _loc_11 = int(_loc_9.desc);
                    _loc_3.vipAttrValue = _loc_3.baseAttrValue * _loc_11 * 0.01;
                }
            }
            return _loc_3;
        }// end function

        override protected function onVipLevelUpHandler(param1:Object) : void
        {
            this.updateAttr();
            this.updateCombat();
            this.updateVipIcon();
            return;
        }// end function

        private function getEquipGainAttr() : Dictionary
        {
            var _loc_4:String = null;
            var _loc_5:ItemData = null;
            var _loc_1:* = Cache.instance.pack.getFashionPackCacheByCode(EAdvanceComponentType._EAdvanceComponentTypeWing).getAllEquip();
            var _loc_2:* = new Dictionary();
            var _loc_3:* = AttributeUtil.attrs.concat();
            _loc_3.splice(2, 1);
            _loc_3.splice(-1);
            for each (_loc_4 in _loc_3)
            {
                
                _loc_2[_loc_4] = 0;
            }
            for each (_loc_5 in _loc_1)
            {
                
                if (ItemsUtil.isPrescriOutTime(_loc_5))
                {
                    continue;
                }
                for each (_loc_4 in _loc_3)
                {
                    
                    _loc_2[_loc_4] = _loc_2[_loc_4] + (_loc_5.itemInfo as ItemEquipInfo)[_loc_4];
                }
            }
            return _loc_2;
        }// end function

        private function onHideWingHandler(event:MouseEvent) : void
        {
            GameProxy.fashion.hideOrShowFashion(EAdvanceComponentType._EAdvanceComponentTypeWing);
            return;
        }// end function

        override protected function onWingEquipUpdate(param1:Object) : void
        {
            this.updateEquip();
            this.updateShapEquip();
            this.updateAttr();
            this.updateCombat();
            return;
        }// end function

        override protected function updatePropItem() : void
        {
            if (_data.advanceInfo.code >= 4)
            {
                _growthItem.isGray = false;
                _growthOpenTip.visible = false;
            }
            if (_data.advanceInfo.code >= 5)
            {
                _talentItem.isGray = false;
                _talentOpenTip.visible = false;
            }
            this.updatePropAmount();
            return;
        }// end function

        override protected function updatePropAmount() : void
        {
            _growthItem.itemData = new ItemData(FashionConst.PropCode_Wing_Growth);
            var _loc_1:* = Cache.instance.pack.backPackCache.getItemCountByItemData(_growthItem.itemData);
            _growthItem.amount = _loc_1;
            if (_loc_1 > 0)
            {
                _growthItem.setAmountLabel(_loc_1 + "");
                if (_data.advanceInfo.code >= 4)
                {
                    _fashionGrowthUseBtn.visible = true;
                    EffectManager.glowFilterReg(_growthItem);
                }
            }
            else
            {
                _fashionGrowthUseBtn.visible = false;
                EffectManager.glowFilterUnReg(_growthItem);
            }
            _talentItem.itemData = new ItemData(FashionConst.PropCode_Wing_Talent);
            var _loc_2:* = Cache.instance.pack.backPackCache.getItemCountByItemData(_talentItem.itemData);
            _talentItem.amount = _loc_2;
            if (_loc_2 > 0)
            {
                _talentItem.setAmountLabel(_loc_2 + "");
                if (_data.advanceInfo.code >= 5)
                {
                    _fashionTalentUseBtn.visible = true;
                    EffectManager.glowFilterReg(_talentItem);
                }
            }
            else
            {
                _fashionTalentUseBtn.visible = false;
                EffectManager.glowFilterUnReg(_talentItem);
            }
            return;
        }// end function

        override protected function useItemHandler(event:MouseEvent) : void
        {
            var _loc_2:ItemData = null;
            var _loc_3:Array = null;
            if (event.target == _fashionGrowthUseBtn)
            {
                if (_growthItem.amount > 0)
                {
                    _loc_3 = Cache.instance.pack.backPackCache.getItemsByGroupCategoryAndType(EGroup._EGroupStuff, EStuff._EStuffAdvance, EAdvanceType._EAdvanceTypeFashionWingGrowth);
                    _loc_2 = _loc_3[0] as ItemData;
                }
                if (_loc_2)
                {
                    GameProxy.packProxy.useItem(_loc_2.uid, _loc_2.itemInfo.code);
                }
            }
            else if (event.target == _fashionTalentUseBtn)
            {
                if (_talentItem.amount > 0)
                {
                    _loc_3 = Cache.instance.pack.backPackCache.getItemsByGroupCategoryAndType(EGroup._EGroupStuff, EStuff._EStuffAdvance, EAdvanceType._EAdvanceTypeFashionWingTalent);
                    _loc_2 = _loc_3[0] as ItemData;
                }
                if (_loc_2)
                {
                    GameProxy.packProxy.useItem(_loc_2.uid, _loc_2.itemInfo.code);
                }
            }
            return;
        }// end function

        private function getVipToolTip() : String
        {
            var _loc_2:String = null;
            var _loc_4:String = null;
            var _loc_1:* = VipConfig.instance.getVipConfigByType(EVipRecordType._EVipRecordTypeWingEffect);
            var _loc_3:int = 1;
            while (_loc_3 <= 10)
            {
                
                if (_loc_1["vip" + _loc_3] == "1")
                {
                    if (this._isActiveVip)
                    {
                        _loc_4 = FashionUtil.getFashionNameByType(_data.type);
                        _loc_2 = Language.getStringByParam(41272, _loc_3, _loc_4, _loc_4, _loc_1.desc);
                    }
                    else
                    {
                        _loc_2 = Language.getStringByParam(41305, _loc_3, _loc_1.desc);
                    }
                    break;
                }
                _loc_3++;
            }
            return _loc_2;
        }// end function

        private function updateVipIcon() : void
        {
            var _loc_2:int = 0;
            var _loc_1:* = VipConfig.instance.getValueByTypeAndLv(EVipRecordType._EVipRecordTypeWingEffect, Cache.instance.vip.level);
            var _loc_3:* = VipConfig.instance.getVipConfigByType(EVipRecordType._EVipRecordTypeWingEffect);
            var _loc_4:int = 1;
            while (_loc_4 <= 10)
            {
                
                if (_loc_3["vip" + _loc_4] == "1")
                {
                    _loc_2 = _loc_4;
                    break;
                }
                _loc_4++;
            }
            if (_loc_1 == "0" || _loc_1 == null)
            {
                _vipIcon.filters = [FilterConst.colorFilter2];
                _vipIcon.imgUrl = GameDefConfig.instance.getVipLevelIconUrl(_loc_2, 2);
                this._isActiveVip = false;
            }
            else
            {
                _vipIcon.filters = [];
                _vipIcon.imgUrl = GameDefConfig.instance.getVipLevelIconUrl(Cache.instance.vip.level, 2);
                this._isActiveVip = true;
            }
            return;
        }// end function

        override protected function updateBtnState() : void
        {
            return;
        }// end function

        override protected function onAttrOverHandler(event:MouseEvent = null) : void
        {
            var _loc_3:TMountConfig = null;
            var _loc_2:* = _data.advanceInfo.code + 1;
            if (_loc_2 <= FashionConst.FashionAdvanceMaxLevel)
            {
                super.onAttrOverHandler(event);
                _levelUpArrow.visible = true;
                this.skillTween();
                this.updateNextModel();
                _beforeAdvance.visible = true;
                _afterAdvance.visible = true;
                _currLevelName.visible = true;
                _currLevelName.text = _data.baseInfo.name;
                _loc_3 = MountConfig.instance.getFashionInfoByCode(_fashionType, _loc_2);
                if (_loc_3)
                {
                    _nextLevelName.visible = true;
                    _nextLevelName.text = _loc_3.name;
                }
                _upCombat.visible = true;
                _upCombatArrow.visible = true;
            }
            return;
        }// end function

        override protected function onAttrOutHandler(event:MouseEvent = null) : void
        {
            var _loc_2:* = _data.advanceInfo.code + 1;
            if (_loc_2 <= FashionConst.FashionAdvanceMaxLevel)
            {
                super.onAttrOutHandler(event);
                _levelUpArrow.visible = false;
                this.skillTween();
                if (_roleModelPlayer)
                {
                    this._tween1 = TweenMax.to(_roleModelPlayer, 0.6, {x:this._modelX, rotationY:0, ease:Quint.easeOut});
                }
                if (_nextModelPlayer)
                {
                    this._tween2 = TweenMax.to(_nextModelPlayer, 0.6, {x:this._modelX, alpha:0.05, ease:Quint.easeOut, onComplete:this.onShowEnd});
                }
                _beforeAdvance.visible = false;
                _afterAdvance.visible = false;
                _currLevelName.visible = false;
                _nextLevelName.visible = false;
                _upCombat.visible = false;
                _upCombatArrow.visible = false;
            }
            return;
        }// end function

        private function skillTween() : void
        {
            if (this._tween1 && this._tween2)
            {
                this._tween1.kill();
                this._tween2.kill();
                this._tween1 = null;
                this._tween2 = null;
            }
            return;
        }// end function

        private function onShowEnd() : void
        {
            if (_rect3d && _nextModelPlayer)
            {
                _rect3d.disposeObj3d(_nextModelPlayer);
                _nextModelPlayer = null;
            }
            return;
        }// end function

        override protected function onWindowDragEnd(event:Event) : void
        {
            if (_rect3d && _roleModelPlayer)
            {
                _rect3d.disposeObj3d(_roleModelPlayer);
                _roleModelPlayer = null;
                this.initRoleModel();
            }
            return;
        }// end function

        override protected function removeAllModel() : void
        {
            if (_rect3d)
            {
                if (_roleModelPlayer)
                {
                    _rect3d.disposeObj3d(_roleModelPlayer);
                    _roleModelPlayer = null;
                }
            }
            return;
        }// end function

        override protected function onAdvanceSucc() : void
        {
            var _loc_3:TMountConfig = null;
            var _loc_4:TMountConfig = null;
            var _loc_1:* = _data.advanceInfo.code;
            var _loc_2:* = _data.advanceInfo.code + 1;
            if (_loc_2 <= FashionConst.FashionAdvanceMaxLevel)
            {
                _loc_3 = MountConfig.instance.getFashionInfoByCode(_fashionType, _loc_1);
                _loc_4 = MountConfig.instance.getFashionInfoByCode(_fashionType, _loc_2);
                if (_loc_4)
                {
                    _currLevelName.text = _loc_3.name;
                    _nextLevelName.text = _loc_4.name;
                    if (_nextModelPlayer)
                    {
                        _nextModelPlayer.wing = _loc_4.modelId;
                        _nextModelPlayer.loadWing();
                    }
                }
            }
            return;
        }// end function

        override protected function onClickTurnBtn(event:MouseEvent) : void
        {
            if (event.target == _modelTurnLeftBtn)
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.FashionModelTurnLeft));
            }
            else if (event.target == _modelTurnRightBtn)
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.FashionModelTurnRight));
            }
            return;
        }// end function

        override protected function stopTurning(event:MouseEvent = null) : void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.FashionModelStopTurning));
            return;
        }// end function

        private function openSmallWin(event:MouseEvent) : void
        {
            var _loc_2:* = event.currentTarget as OtherEquipItem;
            var _loc_3:* = this.getSmallWinTitleData();
            var _loc_4:* = EPlayerItemPosType._EPlayerItemPosTypeFashion + _fashionType;
            EquipBaseWin.instance.setWinData(_loc_3, _loc_4, EGroup._EGroupProp, EProp._EPropFashionWingEquip, _loc_2.pos);
            EquipBaseWin.instance.show(GameController.playerSystem.view.x + 111, GameController.playerSystem.view.y + 190);
            return;
        }// end function

        private function getSmallWinTitleData() : Dictionary
        {
            var _loc_1:* = new Dictionary();
            _loc_1[4] = [{name:"equip", label:Language.getString(41274)}];
            return _loc_1;
        }// end function

        private function putOffEquip(event:MouseEvent) : void
        {
            var _loc_2:* = event.currentTarget as OtherEquipItem;
            if (_loc_2.midLabel)
            {
                return;
            }
            var _loc_3:* = Cache.instance.pack.getFashionPackCacheByCode(_fashionType);
            var _loc_4:* = _loc_3.getEquipByType(_loc_2.pos);
            if (_loc_4)
            {
                GameProxy.fashion.dress(_fashionType, null, _loc_4.uid);
            }
            return;
        }// end function

        protected function addHideFasionBtn() : void
        {
            return;
        }// end function

        private function changeSelected(event:Event) : void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.FashionShowHideShapCard, _fashionType));
            return;
        }// end function

        protected function removeHideFasionBtn() : void
        {
            return;
        }// end function

        private function openWardrobeHandler(event:MouseEvent) : void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.WardrobeOpenWardrobe, _fashionType));
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            EffectManager.glowFilterUnReg(_growthItem);
            EffectManager.glowFilterUnReg(_talentItem);
            super.disposeImpl(param1);
            if (_vipSpr)
            {
                _vipSpr.dispose();
                _vipSpr = null;
            }
            if (_vipIcon)
            {
                _vipIcon.dispose();
                _vipIcon = null;
            }
            this.skillTween();
            this._modelX = 0;
            this._isActiveVip = false;
            return;
        }// end function

    }
}
